--- @param extension Package
--- @param HY HY_Utility
--- @param U Utility
return function(extension, HY, U)
    local hy_shameimaru_aya = General:new(extension, "hy_shameimaru_aya", "ten_k", 4, 4, General.Female)
    local wind_god = fk.CreateSkill {
        name = "wind_god",
    }
    wind_god:addEffect(fk.GameStart, {
        anim_type = "offensive",
        can_trigger = function(self, event, target, player, data)
            return player:hasSkill(wind_god.name) and not table.contains(player.sealedSlots, Player.JudgeSlot)
        end,
        on_cost = Util.TrueFunc,
        on_use = function(self, event, target, player, data)
            local room = player.room
            room:abortPlayerArea(player, Player.JudgeSlot)
        end,
    })
    wind_god:addEffect(fk.EventPhaseChanging, {
        anim_type = "offensive",
        can_trigger = function(self, event, target, player, data)
            return player:hasSkill(wind_god.name) and player == target and (data.phase == Player.Judge or (data.phase == Player.Discard and player:getMark("wind_god-turn") > 0))
        end,
        on_cost = Util.TrueFunc,
        on_use = function(self, event, target, player, data)
            data.phase = Player.Play
        end,
    })
    wind_god:addEffect(fk.Death, {
        anim_type = "offensive",
        can_trigger = function(self, event, target, player, data)
            return player:hasSkill(wind_god.name) and data.damage and data.damage.from and data.damage.from == player
        end,
        on_cost = Util.TrueFunc,
        on_use = function(self, event, target, player, data)
            local room = player.room
            room:setPlayerMark(player, "wind_god-turn", 1)
        end,
    })
    local windstorm = fk.CreateSkill {
        name = "windstorm",
    }
    windstorm:addEffect("viewas", {
        mute_card = false,
        anim_type = "offensive",
        pattern = "slash",
        prompt = function(self, player, selected_cards, selected)
            return "windstorm_prompt:::" .. tostring(player:getMark("windstorm-turn") + 1)
        end,
        card_filter = function(self, player, to_select, selected)
            return table.contains(player:getCardIds("he"), to_select) and #selected < player:getMark("windstorm-turn") + 1
        end,
        view_as = function(self, player, cards)
            if #cards ~= player:getMark("windstorm-turn") + 1 then
                return nil
            end
            local card = Fk:cloneCard("slash")
            card:addSubcards(cards)
            table.insertIfNeed(card.skillNames, "windstorm")
            return card
        end
    })
    windstorm:addEffect(fk.TargetSpecified, {
        anim_type = "offensive",
        can_trigger = function(self, event, target, player, data)
            return player:hasSkill(windstorm.name) and target == player and data.card and data.card.trueName == "slash" and data.firstTarget and
            not table.contains(player:getTableMark("windstorm_slash-turn"), data.card.color)
        end,
        on_cost = function(self, event, target, player, data)
            local room = player.room
            local prompt
            if data.card.color == Card.Black then
                if table.every(data:getAllTargets(), function(t)
                        return t:isNude()
                    end) then
                    return false
                end
                prompt = "windstorm_prompt_black"
            elseif data.card.color == Card.Red then
                prompt = "windstorm_prompt_red"
            else
                prompt = "windstorm_prompt_colorless"
            end
            return room:askToSkillInvoke(player, {
                skill_name = windstorm.name,
                prompt = prompt
            })
        end,
        on_use = function(self, event, target, player, data)
            local room = player.room
            local marks = player:getTableMark("windstorm_slash-turn")
            table.insertIfNeed(marks, data.card.color)
            room:setPlayerMark(player, "windstorm_slash-turn", marks)
            if data.card.color == Card.Black then
                local to
                if #data:getAllTargets() == 1 then
                    to = data:getAllTargets()[1]
                else
                    to = room:askToChoosePlayers(player, {
                        targets = table.filter(data:getAllTargets(), function(t)
                            return not t:isNude()
                        end),
                        min_num = 1,
                        max_num = 1,
                        skill_name = windstorm.name,
                        cancelable = false,
                        prompt = "windstorm_prompt_black_target",
                    })[1]
                end
                local card = room:askToChooseCard(player, {
                    target = to,
                    flag = "he",
                    skill_name = windstorm.name,
                    prompt = "windstorm_prompt_black"
                })
                room:throwCard(card, windstorm.name, to, player)
            elseif data.card.color == Card.Red then
                local e = room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
                if e then
                    local _data = e.data
                    _data.card.extra_data = _data.card.extra_data or {}
                    _data.card.extra_data.windstorm_damage = true
                end
            elseif not player.dead then
                room:drawCards(player, 2, windstorm.name)
            end
        end,
    })
    windstorm:addEffect(fk.DamageCaused, {
        can_refresh = function(self, event, target, player, data)
            return data.to == player and data.card and data.card.extra_data and data.card.extra_data.windstorm_damage and not data.chain
        end,
        on_refresh = function(self, event, target, player, data)
            data:changeDamage(1)
        end
    })
    windstorm:addEffect(fk.CardUseFinished, {
        can_refresh = function(self, event, target, player, data)
            return data.card.extra_data and data.card.extra_data.windstorm_damage
        end,
        on_refresh = function(self, event, target, player, data)
            data.card.extra_data.windstorm_damage = false
        end
    })
    windstorm:addEffect(fk.PreCardUse, {
        can_refresh = function(self, event, target, player, data)
            return data.card.trueName == "slash" and table.contains(data.card.skillNames, "windstorm") and data.from == player
        end,
        on_refresh = function(self, event, target, player, data)
            player.room:addPlayerMark(player, "windstorm-turn", 1)
        end
    })
    extension:loadSkillSkels { wind_god, windstorm }
    hy_shameimaru_aya:addSkill("wind_god")
    hy_shameimaru_aya:addSkill("windstorm")
    Fk:loadTranslationTable {
        ["hy_shameimaru_aya"] = "射命丸文",
        ["#hy_shameimaru_aya"] = "御风疾行",
        ["illustrator:hy_shameimaru_aya"] = "NEKO♨",
        ["designer:hy_shameimaru_aya"] = "黑曜人形",
        ["cv:hy_shameimaru_aya"] = "",

        ["wind_god"] = "风神",
        [":wind_god"] = "你的判定阶段改为出牌阶段。游戏开始时，废除你的判定区。在你杀死一名角色后，本回合你的弃牌阶段改为出牌阶段。",

        ["windstorm"] = "烈风",
        [":windstorm"] = "你可以将X张牌当【杀】使用或打出（X为本回合你以此法使用【杀】的次数+1）。每回合各限一次，你使用的【杀】指定目标后，若此【杀】：为红色，你可以令此【杀】伤害+1；为黑色，你可以弃置其中一个目标一张牌；无颜色，你可以摸两张牌。",
        ["windstorm_prompt"] = "烈风：你可以将%arg张牌当杀使用或打出",
        ["windstorm_prompt_black"] = "烈风：你可以弃置其中一个目标一张牌",
        ["windstorm_prompt_red"] = "烈风：你可以令此【杀】伤害+1",
        ["windstorm_prompt_colorless"] = "烈风：你可以摸两张牌",
        ["windstorm_prompt_black_target"] = "烈风：选择一个目标",
    }
end
